//
//  BindCardInfoVC.m
//  Peso Guide
//
//  Created by macbook on 2025/6/13.
//

#import "BindCardInfoVC.h"
#import "DateAlertView.h"

@interface BindCardInfoVC ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) BaseTableView *tableView;
@property (nonatomic, strong) UIView *whiteView;
@property (nonatomic, strong) UIButton *nextButton;
@property (nonatomic, strong) NSMutableArray *dataArray;
@property (nonatomic, strong) DateAlertView *alertView;

@end

@implementation BindCardInfoVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navView.backgroundColor = ColorHex(@"#1A7A35");
    self.titleLabel.text = [Lang set:@"Identity information"];
    self.backColor = ColorHex(@"#F3F4F8");
    
    CAGradientLayer *layer = [CAGradientLayer new];
    layer.colors = @[(__bridge id)ColorHex(@"#FFBD31").CGColor, (__bridge id)ColorHex(@"#FFFFFF").CGColor];
    layer.startPoint = CGPointMake(0.0, 0.0);
    layer.endPoint = CGPointMake(0.0, 1);
    layer.frame = CGRectMake(0, 0, KScreenWidth, KScreenWidth*0.736);
    [self.view.layer addSublayer:layer];
    
    UILabel *topLabel = [PesoKit createLabelWithFrame:CGRectMake(27, kStarBarHeight, KScreenWidth-54, 66) backGroundColor:[UIColor clearColor] text:[Lang set:@"Please check your lD information correctly.oncesubmilted it is not changed again"] textColor:ColorHex(@"#0E1D31") font:FONT(FontWeightStyleRegular, 12)];
    topLabel.numberOfLines = 0;
    [self.view addSubview:topLabel];
    
    _whiteView = [PesoKit createViewWithFrame:CGRectMake(0, kStarBarHeight+KScreenWidth*0.736*0.24, KScreenWidth, KScreenHeight) backGroundColor:ColorHex(@"#FFFFFF")];
    _whiteView.clipsToBounds = YES;
    _whiteView.layer.cornerRadius = 15.0f;
    [self.view addSubview:_whiteView];
    
    [_whiteView addSubview:self.tableView];
    
    _nextButton = [PesoKit createButtonWithFrame:CGRectMake((KScreenWidth-214)/2.0, KScreenHeight-kSafeBottomHeight-30-44, 214, 44) backGroundColor:ColorHex(@"#FE7133") title:[Lang set:@"Next"] titleColor:ColorHex(@"#FFFFFF") font:FONT(FontWeightStyleMedium, 18)];
    _nextButton.clipsToBounds = YES;
    _nextButton.layer.cornerRadius = 22.0f;
    [_nextButton addTarget:self action:@selector(nextButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_nextButton];
    
    [self.view addSubview:self.navView];
    
    _alertView = [[DateAlertView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
    [self.view addSubview:_alertView];
}

- (void)nextButtonClick {
    
}

#pragma mark - UITableViewDelegate&UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.dataArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    NSString *IdentityInfomationCellIdentifier = [NSString stringWithFormat:@"IdentityInfomationCellIdentifier%ld",(long)indexPath.row];
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:IdentityInfomationCellIdentifier];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:IdentityInfomationCellIdentifier];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 51;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 0.01;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
}

#pragma mark - lazy load
- (BaseTableView *)tableView {
    if (!_tableView) {
        _tableView = [[BaseTableView alloc] initWithFrame:CGRectMake(0, kStarBarHeight+66, KScreenWidth, KScreenHeight-kStarBarHeight-66-kSafeBottomHeight-30-44-20) style:UITableViewStylePlain];
        _tableView.backgroundColor = ColorHex(@"#FFFFFF");
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.scrollEnabled = NO;
    }
    return _tableView;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
